/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package search;

import env.Enviroment;

/**
 *
 * @author user
 */
abstract public class Heuristic {
    protected SearchState state;

     public int h(SearchState state) {
        this.state = state;
        int h=Math.min(dist_farthest_flag(), dist_death());
        if (state.isAlive) {
            h -= Enviroment.FLAG_REWARD * state.getFlags().size();
        }
        return h;
    }
     
     
    abstract int dist_death();
    abstract int dist_farthest_flag();

}
